home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
tex
/
pil50kit.zip
/
IN.PIL
< prev
next >
Wrap
Text File
|
1992-04-09
|
15KB
|
452 lines
/* In the example which follows two PIL files are shown. One describes pages
1 and 2, the other describes the display ad placed on page 2. The PIL file
for pages 1 and 2 would have been generated by a page layout system, that
for the display ad by an ad makeup system.
Additional, content files are needed to fully describe the pages and the
ad. These files are not included in the example.
*/
/* ---------------------------------------------- */
/* FILE DESCRIBING PAGES 1 & 2: /Pages/1_2/P00001 */
/* ---------------------------------------------- */
pil-layout-5.00 "N PAGE 1" {
/* The name table associates entity names with the types of the
entities and their location. The format for each name table entry
is "name", "type", "domain", and "value". The name is the way
by which the entity is identified in a pil-layout; the "type" is
the data format of the entity, and the domain and value, taken
together are used to locate the entity where it is stored, e.g.,
on a file system or database. Thus, the renderable content for the
headline and photo are defined as "postscript" and "tiff" respectively.
The editable content for the FIRE story body text is "ascii-text".
The renderable and editable content locations are specified as "lcd-
filenames". "lcd" stands for "least common denominator". It requires
that the files are in the same directory as the PIL itself and that
the names can be represented as DOS filenames. The domain and value of
"inline" means that the entity appears later in this file. */
name-table {
"N FIRE HD 1" postscript lcd-filename "R00001"
"N FIRE PH 1" tiff lcd-filename "R00002"
"N FIRE BT" ascii-text lcd-filename "E00001"
"N PAGE 2" pil-layout inline inline
}
/* The canvas is the root of the hierarchy. The subordinates are the
following objects which appear in imaging order from lowest to
highest.
"units" specifies how to interpret dimensions, both for
the current object and for those objects which do not re-specify
the units of measure. Thus, units of measure are inherited, down
the tree. In this case units of measure is chosen such that 1 unit
equals 1/1000th of an inch.
"dimensions" provides the horizontal and vertical width of the
canvas. This is the physical imaging area for all content rendered
on the canvas. So, content is clipped to the canvas size. In this
case an 8.5 by 11 inch page is indicated.
"user-name" is an arbitrary string which is not used for final
rendering. Its typical use is to provide a name for the canvas
which is meaningful to a user, and may be used to label an object
when it is drawn in dummy or outline mode.
In addition to these items, a canvas type, clipper and application
specific attributes may be specified. These are not used in this
example. */
canvas {
dimensions { 8500 11000 }
units 25400
user-name "Page 1"
}
/* Objects are used to specify the content which must be rendered
on the canvas. This object represents the headline of the FIRE
story.
The origin coordinates specify the position for the object.
The origin is specified relative to the coordinate system
of the canvas.
The dimensions, along with the origin coordinates, define the
bounding rectangle of the area the object's content is rendered
into. The content is scaled to fit into this area.
An object can also be rotated, and a clip shape defined. In
this example, the default rotation of 0 degrees is taken,
and no clip shape is specified.
Note that z-order is implied by the order of the objects; the
first object is bottommost and the last object is topmost.
Several other attributes can be specified in the body of an object.
These are an identifier, units, type, rotation, clipper, container,
graphic, and application specific attributes. Subsequent examples
indicate the use of these.
The bounding box is defined in the native content space. So,
for PostScript, electronic points are used. The content is
scaled to fit within the rectangle defined by the origin
coordinates and dimensions. The bounding box specifies the
portion of the content that is to be drawn into this rectangle.
Bounding-box is optional. If omitted, the renderer will have
to determine the information from the content itself. For
example, a tagged content architecture might specify the
bounding rectangle as one of its tags. One particular case
is when the content is itself a PIL layout. Here the
dimensions of the referenced PIL canvas provide the bounding
box.
rc-name gives the name for the entity containing the content
("rc" stands for "renderable content"). The entity name table
associates this name with the physical location. In this case
the entity name is "N FIRE HD 1". The name table indicates that
the content is contained by a PostScript file, "R00001", in
the same directory as the PIL file.
The rc-type indicates the kind of data to be rendered.
This is a union of "text", "structured-graphics", "lineart",
and "image". If available, this information can be used by a
renderer to make processing decisions. */
object {
origin { 750 500 }
dimensions { 7000 1500 }
user-name "Fire Story Headline"
bbox { 0 108 252 108 }
rc-name "N FIRE HD 1"
rc-type { text }
}
/* This next object describes the photograph for the FIRE story.
It illustrates the use of some additional PIL constructs. These
are a clipper and a graphic. */
object {
origin { 2500 4450 }
dimensions { 3500 3500 }
user-name "Fire Story Photo"
/* A clipper is used to clip the content of the object.
Note that it is only the content which is clipped -- in
particular the object graphic is not clipped. The clipper
is a shape defined in the object coordinate system. In this
case a clipper is defined to crop the photograph. */
clipper {
rectangle { 0 0 3500 3500 }
}
/* The object-graphic can be used to render simple graphics at the
object level. Examples are rules and boxes. In this case the
graphic is used to render a trap rule for the photograph. The
trap rule is a 1-point wide square. */
graphic {
color-model pantone
render-op stroke
render-attributes {
stroke-color "192"
position outside
width 14
cap butt-cap
join miter-join
miter-limit 10
}
rectangle { 0 0 3500 3500 }
}
bbox { 0 0 350 350 }
rc-name "N FIRE PH 1"
rc-type { image }
}
/* The next two objects define the body text columns of the FIRE story.
These illustrate the use of container shapes and identifiers.
A container shape is used to define a shape for composing content.
A single, closed shape may be specified. This restriction avoids the
problem of defining z-order for multiple, overlapping shapes.
Linkage of containers into flow sequences is specified with the
"text-flow" construct. This construct specifies a series of objects
which are to be linked into a flow sequence. The objects are
identified by their id's. */
object {
id "I FIRE BT 1"
origin { 750 2600 }
dimensions { 3400 8400 }
user-name "Fire Story Body Column 1"
container {
polygon {
{ 0 0 } { 3400 0 }
{ 3400 2300 } { 1700 2300 }
{ 1700 5900 } { 3400 5900 }
{ 3400 8400 } { 0 8400 }
}
}
}
object {
id "I FIRE BT 2"
origin { 4350 2600 }
dimensions { 3400 8400 }
user-name "Fire Story Body Column 2"
container {
polygon {
{ 0 0 } { 3400 0 }
{ 3400 8400 } { 0 8400 }
{ 0 5900 } { 1700 5900 }
{ 1700 2300 } { 0 2300 }
}
}
}
/* This text flow defines the layout and content which forms the
body of the FIRE story. The layout sequence jumps from PAGE 1 to
PAGE 2. This is specified by the "to" entry. */
text-flow {
flow-label "L FIRE BT"
objects { "I FIRE BT 1" "I FIRE